package chapter04.Demo4;

/**
 * 接口
 * 电脑=机箱+电源+主板+CPU+显卡+显存+内存+硬盘+散热
 */
interface JiXaing{//机箱
    String rongLiang="Mini";
    void setRongLiang(String rongLiang);
}
interface DianYuan{
    String gongLv="500";
    void setGongLv(String gongLv);
}
interface CPU{
    String hz="2.4G";
    int coreNum=1;
    void setHz(String hz);
    void setCoreNume(int coreNume);
}
interface ZhuBan{
    String Pinpai="华硕";
    void setPinpai(String Pinpai);
}
interface DianNao extends JiXaing,DianYuan,CPU,ZhuBan{}
// 类继承接口 需要实现所有的接口方法 类用implements继承多个接口
class PersonComputer implements  JiXaing,DianYuan,CPU,ZhuBan{
    public void setPinpai(String Pinpai){
        System.out.println("品牌被final改不了");
    }
    public void setCoreNume(int coreNum){
        System.out.println("核心数量被final改不了");
    }
    public void setGongLv(String gonglv){
        System.out.println("功率被final改不了");
    }
    public void setRongLiang(String rongLiang){
        System.out.println("容量被final改不了");
    }
    public void setHz(String hz){
        System.out.println("赫兹被final改不了");
    }
}
public class Demo4 {
    public static void main(String[] args) {
        PersonComputer pc=new PersonComputer();
        pc.setCoreNume(2);
        System.out.println(pc.hz);
        System.out.println("细数季节周而复始");
    }
}
